/**
 * webpack 配置
 * Created by haoran.shu on 2018/5/2 16:24.
 */
const fs = require('fs');
const path = require('path');
const webpack = require('webpack');

const webpackConfig = {
  entry: './index.js',
  mode: 'development',
  output: {
    filename: 'bundle.js',
    path: __dirname + '/dist/',
  },
  module: {
    rules: [{
      test: /\.js$/,
      exclude: /node_modules/,
      loader: "babel-loader"
    }]
  },
  devServer: {
    clientLogLevel: "warning",
    contentBase: path.join(__dirname),
    hot: true,
    hotOnly: true,
    stats: "errors-only",
    host: '0.0.0.0'
  },
  plugins: [
    new webpack.HotModuleReplacementPlugin()
  ]
}; // webpack 配置

module.exports = webpackConfig;
